package net.cl.support.ibatis;

//import java.io.Reader;
//
//import org.apache.commons.logging.Log;
//import org.apache.commons.logging.LogFactory;
//import org.apache.ibatis.io.Resources;
//import org.apache.ibatis.session.SqlSession;
//import org.apache.ibatis.session.SqlSessionFactory;
//import org.apache.ibatis.session.SqlSessionFactoryBuilder;

public class SessionFactory {
	
//	private static SqlSessionFactory sessionFactory;
//	private static final Log log = LogFactory.getLog(SessionFactory.class);
//
//	public static void createSessionFactory(String config) {
//		try {
//			if (sessionFactory == null) {
//				Reader reader = Resources.getResourceAsReader(config);
//				sessionFactory = new SqlSessionFactoryBuilder().build(reader);
//			}
//		} catch (Exception e) {
//			log.error("Load ibatis configuration error.");
//			log.error(e.getMessage());
//			e.printStackTrace();
//		}
//		log.info("SessionFactory created.");
//	}
//	
//	public static SqlSession getSession() {
//		return sessionFactory.openSession();
//	}
}
